package com.wyk.controller;

import com.wyk.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author WangYuKai
 * @Date 2022/6/21
 * @apiNote
 */
@RestController
@Slf4j
public class OrderConsulController {

    public static final String INVOKE_URL = "http://cloud-sonsul-payment8006";
    //注入模板
    @Autowired
    private RestTemplate restTemplate;

    //调用服务
    @GetMapping("/consumer/consul")
    public String getConsul(){
        return restTemplate.getForObject(INVOKE_URL + "/payment/consul",String.class);
    }
}
